import base64
from io import BytesIO
from typing import Any, Dict

import qrcode


def gen_qr_code(json_data: Dict[str, Any]) -> bytes:
    qr_code = qrcode.make(str(json_data))
    output_buffer = BytesIO()
    qr_code.save(output_buffer)
    byte_data = output_buffer.getvalue()
    qr_code_str = base64.b64encode(byte_data)
    return qr_code_str
